<template>
    <div class="box">
        <div class="box-type">选择支付方式</div>
        <div class="combo-box">
            <div class="combo-box-item" @click="selectPayTypeAction(2)">
                <div class="combo-box-item-left">
                    <input type="radio" value="2" v-model="payType"></input>
                </div>
                <div class="combo-box-item-right">
                    <img src="@/assets/images/wx_logo.png">
                </div>
                <div class="combo-box-item-text">
                    微信
                </div>
            </div>
            <div class="combo-box-item" @click="selectPayTypeAction(1)">
                <div class="combo-box-item-left">
                    <input type="radio" value="1" v-model="payType"></input>
                </div>
                <div class="combo-box-item-right">
                    <img src="@/assets/images/ali_logo.png">
                </div>
                <div class="combo-box-item-text">
                    支付宝
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
  name: 'pay01',
  data () {
    return {
      payType: ''
    }
  },
  methods: {
    selectPayTypeAction (num) {
      this.payType = num
      this.$emit('result', num)
    }
  }
}
</script>

<style scoped lang="less">
    .box {
        margin-top: 40px;

        &-type {
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 10px;
        }
    }

    .combo-box {
        display: flex;

        &-item {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-right: 40px;

            &-left {
                margin-right: 5px;
            }

            &-right {
                border-radius: 4px;
                overflow: hidden;

                img {
                    width: 100%;
                }
            }

            &-text {
                margin-left: 10px;
                font-size: 18px;
                font-weight: bold;
            }
        }
    }
</style>
